Skip to content

Comments

fix: aggregate custom reporter results in run-workers --by suite (#5411)#5444

Closed
mirao wants to merge 1 commit intocodeceptjs:4.xfrom
mirao:fix/run-workers-reporter-aggregation-5411-4x
Closed

fix: aggregate custom reporter results in run-workers --by suite (#5411)#5444
mirao wants to merge 1 commit intocodeceptjs:4.xfrom
mirao:fix/run-workers-reporter-aggregation-5411-4x

Conversation

@mirao
Copy link
Contributor

@mirao mirao commented Feb 9, 2026

Summary

  • When using run-workers with --by suite, custom reporters (mochawesome, mocha-junit-reporter, etc.) only contained data from the last worker because each worker independently ran the reporter and overwrote the same output files
  • Strip custom reporters from worker configs and replay aggregated results through the reporter in the main thread after all workers complete
  • Handles both single-output and config.multiple (per-browser) scenarios with correct path resolution for nested reporter options

Test plan

  • Unit test verifies _runReporters() replays aggregated results through a custom reporter
  • Acceptance test verifies mochawesome JSON + HTML reports contain all suites when using --by suite
  • Acceptance test verifies per-browser reports with config.multiple each contain all suites
  • All existing worker unit tests pass (11 passing)
  • All existing worker runner tests pass (31 passing)

Fixes #5411

🤖 Generated with Claude Code

…eceptjs#5411)

When using run-workers with --by suite, custom reporters (mochawesome,
mocha-junit-reporter, etc.) only contained data from the last worker
because each worker independently ran the reporter and overwrote the
same output files.

Strip custom reporters from worker configs and replay aggregated results
through the reporter in the main thread after all workers complete.
Handles both single-output and config.multiple (per-browser) scenarios
with correct path resolution for nested reporter options.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@DavertMik DavertMik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this implementation seems like totally overrides how plugins are built and prefers mocha reporters instead. It adds additional complexity, hardcodes mocha reporters, and expothes them to codecept API

Code doesn't follow any project logic

Workers are for running Codecept API tests, enhancing mocha config on fly is a dangerous side-effect

@DavertMik DavertMik closed this Feb 25, 2026
@DavertMik
Copy link
Contributor

@mirao I would recommend to create a plugin for junit reporter instead
Using Claude this would be easier and much cleaner solution than relying on outdated mocha's junit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants